﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class GrayEffect : MonoBehaviour {

	public Material mat;
	
	void Start ()
	{
		enabled = false;
	}

	public void ShowEffect()
	{
		if (mat)
		{
			enabled = true;
		}
	}
	
	public void EndEffect()
	{
		enabled = false;
	}


	void OnRenderImage(RenderTexture src, RenderTexture dest)
	{
		Graphics.Blit(src, dest, mat);
	}
}
